package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	Id        uint32         `gorm:"column:id;type:int UNSIGNED;comment:用户id;primaryKey;not null;" form:"id" json:"id"`        // 用户id
	Mobile    string         `gorm:"column:mobile;type:char(11);comment:账号;not null;" form:"mobile" json:"mobile"`             // 账号
	Password  string         `gorm:"column:password;type:char(32);comment:密码;not null;" form:"password" json:"password"`       // 密码
	NickName  string         `gorm:"column:nick_name;type:varchar(30);comment:昵称;not null;" form:"nick_name" json:"nick_name"` // 昵称
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" form:"created_at" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" form:"updated_at" json:"updated_at"`
	DeletedEt gorm.DeletedAt `gorm:"column:deleted_et;type:datetime(3);default:NULL;" form:"deleted_et" json:"deleted_et"`
}

func (u User) TableName() string {
	return "user"
}
